package org.jumiz.telnet.play;

import java.util.concurrent.ConcurrentHashMap;

/**
 *
 */
public abstract class AbstractPlay implements Cloneable {

    private static ConcurrentHashMap<String, AbstractPlay> values = new ConcurrentHashMap<>();

    public static void register(String number, AbstractPlay play) {
        values.put(number, play);
    };

    public abstract boolean isEnd();

    public abstract String first(String common);

    public abstract String next(String common);

    public abstract String end(String common);

    public abstract String name();

    public static ConcurrentHashMap<String, ? extends AbstractPlay> getValues() {
        return values;
    }

    @Override
    public abstract AbstractPlay clone();
}
